<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateCronLogsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('cron_logs', function (Blueprint $table) {
            $table->id();
            $table->string('name',50)->comment('任务名称');
            $table->string('event',255)->comment('执行事件');
            $table->timestamp('execute_time')->comment('执行时间');
            $table->unsignedBigInteger('relate_id')->comment('关联关键字id');
            $table->unsignedInteger('is_success')->default(1)->comment('是否成功');
            $table->text('message')->comment('返回消息');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('cron_logs');
    }
}
